<!DOCTYPE html>
<html>
<head>
    

    

    



    <meta charset="utf-8">
    
    
    
    
    <title>No title | 流沙 | subtitle</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    
    <meta name="theme-color" content="#3F51B5">
    
    
    <meta name="keywords" content="">
    <meta name="description" content="java基础jvm内存划分内存泄漏,无限a = new object() vector.add(a) a=null当集合里面的对象属性被修改后 hashcode变了  hashmap里面的没有变 垃圾回收垃圾回收算法 集合ArrayList和LinkedListhashmap concurrenthashmaphashmap如何解决链表过长？红黑树有哪些特性？ set线程安全线程池线程池的四种 e">
<meta name="keywords" content="关键字">
<meta property="og:type" content="article">
<meta property="og:title" content="No title">
<meta property="og:url" content="https://gitwmg.gitee.io/hexoblog/2018/11/01/java/index.html">
<meta property="og:site_name" content="流沙">
<meta property="og:description" content="java基础jvm内存划分内存泄漏,无限a = new object() vector.add(a) a=null当集合里面的对象属性被修改后 hashcode变了  hashmap里面的没有变 垃圾回收垃圾回收算法 集合ArrayList和LinkedListhashmap concurrenthashmaphashmap如何解决链表过长？红黑树有哪些特性？ set线程安全线程池线程池的四种 e">
<meta property="og:locale" content="zh-CN">
<meta property="og:image" content="http://pic.wmgblog.pw/20180824180153.jpg">
<meta property="og:image" content="http://pic.wmgblog.pw/20180824184042.png">
<meta property="og:image" content="http://hi.csdn.net/attachment/201009/25/0_1285421756PHyZ.gif">
<meta property="og:updated_time" content="2018-11-01T06:32:56.860Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="No title">
<meta name="twitter:description" content="java基础jvm内存划分内存泄漏,无限a = new object() vector.add(a) a=null当集合里面的对象属性被修改后 hashcode变了  hashmap里面的没有变 垃圾回收垃圾回收算法 集合ArrayList和LinkedListhashmap concurrenthashmaphashmap如何解决链表过长？红黑树有哪些特性？ set线程安全线程池线程池的四种 e">
<meta name="twitter:image" content="http://pic.wmgblog.pw/20180824180153.jpg">
    
        <link rel="alternate" type="application/atom+xml" title="流沙" href="/hexoblog/atom.xml">
    
    <link rel="shortcut icon" href="/hexoblog/favicon.ico">
    <link rel="stylesheet" href="//unpkg.com/hexo-theme-material-indigo@latest/css/style.css">
    <script>window.lazyScripts=[]</script>

    <!-- custom head -->
    

</head>

<body>
    <div id="loading" class="active"></div>

    <aside id="menu" class="hide" >
  <div class="inner flex-row-vertical">
    <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menu-off">
        <i class="icon icon-lg icon-close"></i>
    </a>
    <div class="brand-wrap" style="background:#3F51B5">
      <div class="brand">
        <a href="/hexoblog/" class="avatar waves-effect waves-circle waves-light">
          <img src="/hexoblog/img/avatar.jpeg">
        </a>
        <hgroup class="introduce">
          <h5 class="nickname">Wang</h5>
          <a href="mailto:919767736@qq.com" title="919767736@qq.com" class="mail">919767736@qq.com</a>
        </hgroup>
      </div>
    </div>
    <div class="scroll-wrap flex-col">
      <ul class="nav">
        
            <li class="waves-block waves-effect">
              <a href="/hexoblog/"  >
                <i class="icon icon-lg icon-home"></i>
                主页
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/hexoblog/archives"  >
                <i class="icon icon-lg icon-archives"></i>
                归档
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/hexoblog/tags"  >
                <i class="icon icon-lg icon-tags"></i>
                标签
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/hexoblog/categories"  >
                <i class="icon icon-lg icon-th-list"></i>
                分类
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://github.com" target="_blank" >
                <i class="icon icon-lg icon-github"></i>
                Github
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="http://www.weibo.com" target="_blank" >
                <i class="icon icon-lg icon-weibo"></i>
                微博
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="http://ftp.wmgblog.pw"  >
                <i class="icon icon-lg icon-link"></i>
                FTP
              </a>
            </li>
        
      </ul>
    </div>
  </div>
</aside>

    <main id="main">
        <header class="top-header" id="header">
    <div class="flex-row">
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light on" id="menu-toggle">
          <i class="icon icon-lg icon-navicon"></i>
        </a>
        <div class="flex-col header-title ellipsis">No title</div>
        
        <div class="search-wrap" id="search-wrap">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="back">
                <i class="icon icon-lg icon-chevron-left"></i>
            </a>
            <input type="text" id="key" class="search-input" autocomplete="off" placeholder="输入感兴趣的关键字">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="search">
                <i class="icon icon-lg icon-search"></i>
            </a>
        </div>
        
        
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menuShare">
            <i class="icon icon-lg icon-share-alt"></i>
        </a>
        
		
		 
		  <a href="/hexoblog/atom.xml" target="_blank" class="header-icon waves-effect waves-circle waves-light rss" id="menuShare">
           <i class="icon icon-lg icon-rss"></i>
        </a>
            
			
    </div>
</header>
<header class="content-header post-header">

    <div class="container fade-scale">
        <h1 class="title">No title</h1>
        <h5 class="subtitle">
            
                <time datetime="2018-11-01T06:32:56.860Z" itemprop="datePublished" class="page-time">
  2018-11-01
</time>


            
        </h5>
    </div>

    


</header>


<div class="container body-wrap">
    
    <aside class="post-widget">
        <nav class="post-toc-wrap post-toc-shrink" id="post-toc">
            <h4>TOC</h4>
            <ol class="post-toc"><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#java基础"><span class="post-toc-number">1.</span> <span class="post-toc-text">java基础</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#jvm内存划分"><span class="post-toc-number">1.1.</span> <span class="post-toc-text">jvm内存划分</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#垃圾回收"><span class="post-toc-number">1.2.</span> <span class="post-toc-text">垃圾回收</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#集合"><span class="post-toc-number">1.3.</span> <span class="post-toc-text">集合</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#ArrayList和LinkedList"><span class="post-toc-number">1.3.1.</span> <span class="post-toc-text">ArrayList和LinkedList</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#hashmap-concurrenthashmap"><span class="post-toc-number">1.3.2.</span> <span class="post-toc-text">hashmap concurrenthashmap</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#set"><span class="post-toc-number">1.3.3.</span> <span class="post-toc-text">set</span></a></li></ol></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#线程安全"><span class="post-toc-number">1.4.</span> <span class="post-toc-text">线程安全</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#线程池"><span class="post-toc-number">1.5.</span> <span class="post-toc-text">线程池</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#锁"><span class="post-toc-number">1.6.</span> <span class="post-toc-text">锁</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#锁优化"><span class="post-toc-number">1.6.1.</span> <span class="post-toc-text">锁优化</span></a></li></ol></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#Synchronized-Lock"><span class="post-toc-number">1.7.</span> <span class="post-toc-text">Synchronized Lock</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#io"><span class="post-toc-number">1.8.</span> <span class="post-toc-text">io</span></a></li></ol></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#算法"><span class="post-toc-number">2.</span> <span class="post-toc-text">算法</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#排序"><span class="post-toc-number">2.1.</span> <span class="post-toc-text">排序</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#链表"><span class="post-toc-number">2.2.</span> <span class="post-toc-text">链表</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#外排序"><span class="post-toc-number">2.3.</span> <span class="post-toc-text">外排序</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#topk"><span class="post-toc-number">2.4.</span> <span class="post-toc-text">topk</span></a></li></ol></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#数据库"><span class="post-toc-number">3.</span> <span class="post-toc-text">数据库</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#索引"><span class="post-toc-number">3.1.</span> <span class="post-toc-text">索引</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#悲观乐观锁"><span class="post-toc-number">3.2.</span> <span class="post-toc-text">悲观乐观锁</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#Sql优化"><span class="post-toc-number">3.3.</span> <span class="post-toc-text">Sql优化</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#mysql事务隔离级别"><span class="post-toc-number">3.4.</span> <span class="post-toc-text">mysql事务隔离级别</span></a></li></ol></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#计算机网络"><span class="post-toc-number">4.</span> <span class="post-toc-text">计算机网络</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#四挥手"><span class="post-toc-number">4.1.</span> <span class="post-toc-text">四挥手</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#三握手"><span class="post-toc-number">4.2.</span> <span class="post-toc-text">三握手</span></a></li></ol></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#web方向"><span class="post-toc-number">5.</span> <span class="post-toc-text">web方向</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#Redis"><span class="post-toc-number">5.1.</span> <span class="post-toc-text">Redis</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#数据结构"><span class="post-toc-number">5.1.1.</span> <span class="post-toc-text">数据结构</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#面试大体上包括下面几方面知识类型："><span class="post-toc-number">5.1.2.</span> <span class="post-toc-text">面试大体上包括下面几方面知识类型：</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#面试常问的知识点"><span class="post-toc-number">5.1.3.</span> <span class="post-toc-text">面试常问的知识点</span></a></li></ol></li></ol></li></ol>
        </nav>
    </aside>


<article id="post-java"
  class="post-article article-type-post fade" itemprop="blogPost">

    <div class="post-card">
        <h1 class="post-card-title">No title</h1>
        <div class="post-meta">
            <time class="post-time" title="2018-11-01 14:32:56" datetime="2018-11-01T06:32:56.860Z"  itemprop="datePublished">2018-11-01</time>

            


            
<span id="busuanzi_container_page_pv" title="文章总阅读量" style='display:none'>
    <i class="icon icon-eye icon-pr"></i><span id="busuanzi_value_page_pv"></span>
</span>


        </div>
        <div class="post-content" id="post-content" itemprop="postContent">
            <h1 id="java基础"><a href="#java基础" class="headerlink" title="java基础"></a>java基础</h1><h2 id="jvm内存划分"><a href="#jvm内存划分" class="headerlink" title="jvm内存划分"></a>jvm内存划分</h2><p>内存泄漏,无限a = new object() vector.add(a) a=null<br>当集合里面的对象属性被修改后 hashcode变了  hashmap里面的没有变</p>
<h2 id="垃圾回收"><a href="#垃圾回收" class="headerlink" title="垃圾回收"></a>垃圾回收</h2><p>垃圾回收算法</p>
<h2 id="集合"><a href="#集合" class="headerlink" title="集合"></a>集合</h2><h3 id="ArrayList和LinkedList"><a href="#ArrayList和LinkedList" class="headerlink" title="ArrayList和LinkedList"></a>ArrayList和LinkedList</h3><h3 id="hashmap-concurrenthashmap"><a href="#hashmap-concurrenthashmap" class="headerlink" title="hashmap concurrenthashmap"></a>hashmap concurrenthashmap</h3><p>hashmap如何解决链表过长？红黑树有哪些特性？</p>
<h3 id="set"><a href="#set" class="headerlink" title="set"></a>set</h3><h2 id="线程安全"><a href="#线程安全" class="headerlink" title="线程安全"></a>线程安全</h2><h2 id="线程池"><a href="#线程池" class="headerlink" title="线程池"></a>线程池</h2><p><a href="https://blog.csdn.net/fanzhijian110/article/details/53572691" target="_blank" rel="noopener">线程池的四种</a></p>
<p><code>ewCachedThreadPool</code>存型线程池，先查看池中有没有以前建立的线程，如果有，就重用，如果没有，就建一个新的线程加入池中。如果线程池长度超过处理需要，可灵活回收空闲线程，若无可回收，则新建线程</p>
<p><code>newFixedThreadPool</code> 定长线程池，可控制线程最大并发数。如果当前需要执行的任务超过池大小，那么多出的任务处于等待状态，直到有空闲下来的线程执行任务，如果当前需要执行的任务小于池大小，空闲的线程也不会去销毁。 </p>
<p><code>newScheduledThreadPool</code> 调度型线程池,支持定时及周期性任务执行，也是一个固定长度的线程池。 </p>
<p><code>newSingleThreadExecutor</code>  单线程化的线程池，它只会用唯一的工作线程来执行任务，保证所有任务按照指定顺序(FIFO, LIFO, 优先级)执行。如果当前线程意外终止，会创建一个新线程继续执行任务，这和我们直接创建线程不同，也和newFixedThreadPool(1)不同。 </p>
<p>1000个多并发线程，10台机器，每台机器4核的，设计线程池大小。</p>
<h2 id="锁"><a href="#锁" class="headerlink" title="锁"></a>锁</h2><p><a href="https://www.cnblogs.com/dolphin0520/p/3923167.html" target="_blank" rel="noopener">锁</a></p>
<p>怎么样实现公平锁？实现机制？</p>
<p><strong>Lock和synchronized的选择</strong> </p>
<p>　   1）Lock是一个接口，而synchronized是Java中的关键字，synchronized是内置的语言实现；</p>
<p>　　2）synchronized在发生异常时，会自动释放线程占有的锁，因此不会导致死锁现象发生；而Lock在发生异常时，如果没有主动通过unLock()去释放锁，则很可能造成死锁现象，因此使用Lock时需要在finally块中释放锁；</p>
<p>　　3）Lock可以让等待锁的线程响应中断，而synchronized却不行，使用synchronized时，等待的线程会一直等待下去，不能够响应中断；</p>
<p>　　4）通过Lock可以知道有没有成功获取锁，而synchronized却无法办到。</p>
<p>　　5）Lock可以提高多个线程进行读操作的效率。</p>
<p>ReadWriteLock就是读写锁，它是一个接口，ReentrantReadWriteLock实现了这个接口。 可以通过readLock()获取读锁，通过writeLock()获取写锁。 </p>
<h3 id="锁优化"><a href="#锁优化" class="headerlink" title="锁优化"></a>锁优化</h3><p>减少锁的时间<br>减少锁的粒度<br>锁粗话<br>读写锁<br>cas </p>
<h2 id="Synchronized-Lock"><a href="#Synchronized-Lock" class="headerlink" title="Synchronized Lock"></a>Synchronized Lock</h2><p>JDK动态加载。</p>
<h2 id="io"><a href="#io" class="headerlink" title="io"></a>io</h2><p>Java 的引用类型有哪几种：强引用、软引用、弱引用和虚引用<br>class字节码文件格式是什么</p>
<h1 id="算法"><a href="#算法" class="headerlink" title="算法"></a>算法</h1><h2 id="排序"><a href="#排序" class="headerlink" title="排序"></a>排序</h2><h2 id="链表"><a href="#链表" class="headerlink" title="链表"></a>链表</h2><h2 id="外排序"><a href="#外排序" class="headerlink" title="外排序"></a>外排序</h2><h2 id="topk"><a href="#topk" class="headerlink" title="topk"></a>topk</h2><p>LRU</p>
<h1 id="数据库"><a href="#数据库" class="headerlink" title="数据库"></a>数据库</h1><h2 id="索引"><a href="#索引" class="headerlink" title="索引"></a>索引</h2><h2 id="悲观乐观锁"><a href="#悲观乐观锁" class="headerlink" title="悲观乐观锁"></a>悲观乐观锁</h2><h2 id="Sql优化"><a href="#Sql优化" class="headerlink" title="Sql优化"></a>Sql优化</h2><p>除非必要，否则不要在关键词前加% </p>
<p>避免在索引字段上使用not，&lt;&gt;，!= </p>
<p>避免对索引字段进行计算操作 </p>
<p><strong>避免在WHERE子句中使用in，not  in，or 或者having</strong>。 </p>
<h2 id="mysql事务隔离级别"><a href="#mysql事务隔离级别" class="headerlink" title="mysql事务隔离级别"></a>mysql事务隔离级别</h2><p><a href="https://www.cnblogs.com/AndyAo/p/8177872.html" target="_blank" rel="noopener">https://www.cnblogs.com/AndyAo/p/8177872.html</a></p>
<h1 id="计算机网络"><a href="#计算机网络" class="headerlink" title="计算机网络"></a>计算机网络</h1><h2 id="四挥手"><a href="#四挥手" class="headerlink" title="四挥手"></a>四挥手</h2><h2 id="三握手"><a href="#三握手" class="headerlink" title="三握手"></a>三握手</h2><h1 id="web方向"><a href="#web方向" class="headerlink" title="web方向"></a>web方向</h1><p>http与https<br>一次请求过程<br>session cookice<br> http头部格式</p>
<h2 id="Redis"><a href="#Redis" class="headerlink" title="Redis"></a>Redis</h2><h3 id="数据结构"><a href="#数据结构" class="headerlink" title="数据结构"></a>数据结构</h3><p>String: 字符串<br>Hash: 散列<br>List: 列表<br>Set: 集合<br>Sorted Set: 有序集合</p>
<p><a href="https://blog.csdn.net/xlgen157387/article/details/79530877" target="_blank" rel="noopener">https://blog.csdn.net/xlgen157387/article/details/79530877</a></p>
<p>缓存穿透<br>找不到去查库、并且对该key并发请求量很大<br>对查询结果为空的情况也进行缓存<br>对key进行过滤</p>
<p>缓存雪崩<br>大量缓存集中在某一个时间段失效、不同的key，设置不同的过期时间、二级缓存。</p>
<p>缓存预热<br>缓存更新<br>缓存降级</p>
<p>bitmap<br>hash</p>
<p>两个10G的文件，里面是一些url，内存只有1G，如何将这两个文件合并，找到相同的url？</p>
<p>代码题：两个有序数组，数组中存在重复数字，合并成一个有序数组，去除重复数字。<br>比较关心平时的学习方式，项目中团队成员之间的沟通，如何解决分歧这些问题</p>
<p>字符串左旋<br>翻转左边，右边 翻转整体</p>
<h3 id="面试大体上包括下面几方面知识类型："><a href="#面试大体上包括下面几方面知识类型：" class="headerlink" title="面试大体上包括下面几方面知识类型："></a>面试大体上包括下面几方面知识类型：</h3><p>Java基础、多线程、IO与NIO、虚拟机、设计模式</p>
<p>数据结构与算法（要有手写算法的能力）</p>
<p>计算机网络（TCP三次握手和四次挥手）</p>
<p>数据通信(RESTful、RPC、消息队列)</p>
<p>操作系统（Linux的基本命令以及使用）</p>
<p>主流框架（Spring底层原理与源码问的很多）</p>
<p>数据存储（最常见的是MySQL、Redis）</p>
<p>分布式</p>
<p>除了这些东西还有什么其他问题：</p>
<p>实际场景题</p>
<p>生活方面的问题</p>
<p>性格/其他方面的问题</p>
<h3 id="面试常问的知识点"><a href="#面试常问的知识点" class="headerlink" title="面试常问的知识点"></a>面试常问的知识点</h3><p>1）集合相关问题（必问）<br>HashMap、LinkedHashMap、ConcurrentHashMap、ArrayList、LinkedList的底层实现</p>
<p>HashMap和Hashtable的区别</p>
<p>ArrayList、LinkedList、Vector的区别</p>
<p>HashMap和ConcurrentHashMap的区别</p>
<p>HashMap和LinkedHashMap的区别</p>
<p>HashMap是线程安全的吗</p>
<p>ConcurrentHashMap是怎么实现线程安全的</p>
<p>HashMap 的长度为什么是2的幂次方</p>
<p>2）多线程并发相关问题（必问）<br>创建线程的3种方式</p>
<p>什么是线程安全</p>
<p>Runnable接口和Callable接口的区别</p>
<p>wait方法和sleep方法的区别</p>
<p>synchronized、Lock、ReentrantLock、ReadWriteLock</p>
<p>介绍下CAS(无锁技术)，什么是悲观锁和乐观锁</p>
<p>volatile关键字的作用和原理</p>
<p>什么是ThreadLocal</p>
<p>创建线程池的4种方式</p>
<p>ThreadPoolExecutor的内部工作原理</p>
<p>分布式环境下，怎么保证线程安全</p>
<p>synchronized和lock区别以及volatile和synchronized的区别</p>
<p>3）JVM相关问题<br>介绍下垃圾收集机制（在什么时候，对什么，做了什么）。</p>
<p>垃圾收集有哪些算法，各自的特点。</p>
<p>标记-清除算法、复制算法、标记-整理算法、分代收集算法</p>
<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="http://pic.wmgblog.pw/20180824180153.jpg" alt="" title="">
                </div>
                <div class="image-caption"></div>
            </figure>
<p>类加载的过程。</p>
<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="http://pic.wmgblog.pw/20180824184042.png" alt="" title="">
                </div>
                <div class="image-caption"></div>
            </figure>
<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="http://hi.csdn.net/attachment/201009/25/0_1285421756PHyZ.gif" alt="" title="">
                </div>
                <div class="image-caption"></div>
            </figure>
<p>双亲委派模型。</p>
<p>如果一个类加载器收到了类加载的请求，它首先不会自己尝试去加载这个类，而是把这个请求委派给父类加载器，每一个层次的类加载器都是加此，因此所有的加载请求最终到达顶层的启动类加载器，只有当父类加载器反馈自己无法完成加载请求时（指它的搜索范围没有找到所需的类），子类加载器才会尝试自己去加载</p>
<p>有哪些类加载器。</p>
<p>能不能自己写一个类叫java.lang.String。</p>
<p>不能自己写以”java.”开头的类，其要么不能加载进内存，要么即使你用自定义的类加载器去强行加载，也会收到一个SecurityException。</p>
<p>4）设计模式相关问题（必问）<br>设计模式比较常见的就是让你手写一个单例模式（注意单例模式的几种不同的实现方法）或者让你说一下某个常见的设计模式在你的项目中是如何使用的，另外面试官还有可能问你抽象工厂和工厂方法模式的区别、工厂模式的思想这样的问题。</p>
<p>另外，建议把代理模式、观察者模式、（抽象）工厂模式好好看一下，这三个设计模式很有用。</p>
<p>5）数据库相关问题，针对MySQL（必问）<br>给题目让你手写SQL。</p>
<p>有没有SQL优化经验。</p>
<p>MySQL索引的数据结构。</p>
<p>SQL怎么进行优化。</p>
<p>SQL关键字的执行顺序。</p>
<p>有哪几种索引。</p>
<p>什么时候该（不该）建索引。</p>
<p>Explain包含哪些列。</p>
<p>6）框架相关问题<br>Hibernate和Mybatis的区别。</p>
<p>Spring MVC和Struts2的区别。</p>
<p>Spring用了哪些设计模式。</p>
<p>Spring中AOP主要用来做什么。</p>
<p>Spring注入bean的方式。</p>
<p>什么是IOC，什么是依赖注入。</p>
<p>Spring是单例还是多例，怎么修改。</p>
<p>Spring事务隔离级别和传播性。</p>
<p>介绍下Mybatis/Hibernate的缓存机制。</p>
<p>Mybatis的mapper文件中#和$的区别。</p>
<p>Mybatis的mapper文件中resultType和resultMap的区别。</p>
<p>7）其他遇到问题<br>介绍下栈和队列。</p>
<p>IO和NIO的区别。</p>
<p>接口和抽象类的区别。</p>
<p>int和Integer的自动拆箱/装箱相关问题。</p>
<p>常量池相关问题。</p>
<p>==和equals的区别。</p>
<p>什么是JDK?什么是JRE？什么是JVM？三者之间的联系与区别</p>
<p>Java和C++的区别</p>
<p>重载和重写的区别。</p>
<p>String和StringBuilder、StringBuffer的区别。</p>
<p>静态变量、实例变量、局部变量线程安全吗，为什么。</p>
<p>try、catch、finally都有return语句时执行哪个。</p>
<p>介绍下B树、二叉树。</p>
<p>分布式锁的实现。</p>
<p>分布式session存储解决方案。</p>
<p>常用的linux命令。</p>
<p>四  一些经验分享<br>先投一些普通公司，等面出了心得再去投理想的公司。</p>
<p>不熟悉的技术不要主动提。</p>
<p>对于那种实习期6个月还打8折的公司，除非你没有其他选择了，否则不要去。 另外，小公司喜欢在薪水上压你，开的时候适当提高。</p>
<p>不要去参加招聘会，纯粹是浪费时间。</p>
<p>把面试当作一次技术的交流，不要太在意是否能被录取。</p>
<p>公司一般面完就决定是否录取了，让你回去等消息这种情况一般没戏，无论你自己觉得面的有多好。</p>
<p>尽量少通过电话面试，效果不好。</p>
<p>在面试的日子里，要保持每天学习，无论是学习新东西还是复习旧东西。</p>
<p>拿到offer了，问问自己这个公司让自己100%满意了吗，如果不是，请继续努力找更好的。</p>
<p>通过面试官可以大概判断这家公司的情况。</p>
<p>拉勾投的简历很多会被筛掉，但是拉勾还是面试机会的最主要来源。 理想的公司可以多投几次，我有好几次都是第一次投被筛掉，多投几次就过的经验。 问到自己有深入研究过的知识，抓住机会好好表现，不要轻易放过。</p>

        </div>

        <blockquote class="post-copyright">
    
    <div class="content">
        
<span class="post-time">
    最后更新时间：<time datetime="2018-11-01T06:32:56.860Z" itemprop="dateUpdated">2018-11-01 14:32:56</time>
</span><br>


        
        作者留言区
        
    </div>
    
    <footer>
        <a href="https://gitwmg.gitee.io/hexoblog">
            <img src="/hexoblog/img/avatar.jpeg" alt="Wang">
            Wang
        </a>
    </footer>
</blockquote>

        
<div class="page-reward">
    <a id="rewardBtn" href="javascript:;" class="page-reward-btn waves-effect waves-circle waves-light">赏</a>
</div>



        <div class="post-footer">
            

            
<div class="page-share-wrap">
    

<div class="page-share" id="pageShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=https://gitwmg.gitee.io/hexoblog/2018/11/01/java/&title=《No title》 — 流沙&pic=https://gitwmg.gitee.io/hexoblog/img/avatar.jpeg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=https://gitwmg.gitee.io/hexoblog/2018/11/01/java/&title=《No title》 — 流沙&source=描述" data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https://gitwmg.gitee.io/hexoblog/2018/11/01/java/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《No title》 — 流沙&url=https://gitwmg.gitee.io/hexoblog/2018/11/01/java/&via=https://gitwmg.gitee.io/hexoblog" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=https://gitwmg.gitee.io/hexoblog/2018/11/01/java/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>



    <a href="javascript:;" id="shareFab" class="page-share-fab waves-effect waves-circle">
        <i class="icon icon-share-alt icon-lg"></i>
    </a>
</div>



        </div>
    </div>

    
<nav class="post-nav flex-row flex-justify-between">
  
    <div class="waves-block waves-effect prev">
      <a href="/hexoblog/2018/11/01/redis/" id="post-prev" class="post-nav-link">
        <div class="tips"><i class="icon icon-angle-left icon-lg icon-pr"></i> Prev</div>
        <h4 class="title">redis单机安装及集群安装</h4>
      </a>
    </div>
  

  
    <div class="waves-block waves-effect next">
      <a href="/hexoblog/2018/08/23/mysqlindex/" id="post-next" class="post-nav-link">
        <div class="tips">Next <i class="icon icon-angle-right icon-lg icon-pl"></i></div>
        <h4 class="title">mysql索引</h4>
      </a>
    </div>
  
</nav>



    

















</article>

<div id="reward" class="page-modal reward-lay">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <h3 class="reward-title">
        <i class="icon icon-quote-left"></i>
        谢谢~
        <i class="icon icon-quote-right"></i>
    </h3>
    <div class="reward-content">
        
        <div class="reward-code">
            <img id="rewardCode" src="/hexoblog/img/wechat.jpg" alt="打赏二维码">
        </div>
        
        <label class="reward-toggle">
            <input id="rewardToggle" type="checkbox" class="reward-toggle-check"
                data-wechat="/hexoblog/img/wechat.jpg" data-alipay="/hexoblog/img/alipay.jpg">
            <div class="reward-toggle-ctrol">
                <span class="reward-toggle-item wechat">微信</span>
                <span class="reward-toggle-label"></span>
                <span class="reward-toggle-item alipay">支付宝</span>
            </div>
        </label>
        
    </div>
</div>



</div>

        <footer class="footer">
    <div class="bottom">
        <p><span>Wang &copy; 2017 - 2018</span>
            <span>
                
            </span>
        </p>
    </div>
</footer>

    </main>
    <div class="mask" id="mask"></div>
<a href="javascript:;" id="gotop" class="waves-effect waves-circle waves-light"><span class="icon icon-lg icon-chevron-up"></span></a>



<div class="global-share" id="globalShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=https://gitwmg.gitee.io/hexoblog/2018/11/01/java/&title=《No title》 — 流沙&pic=https://gitwmg.gitee.io/hexoblog/img/avatar.jpeg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=https://gitwmg.gitee.io/hexoblog/2018/11/01/java/&title=《No title》 — 流沙&source=描述" data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https://gitwmg.gitee.io/hexoblog/2018/11/01/java/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《No title》 — 流沙&url=https://gitwmg.gitee.io/hexoblog/2018/11/01/java/&via=https://gitwmg.gitee.io/hexoblog" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=https://gitwmg.gitee.io/hexoblog/2018/11/01/java/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>


<div class="page-modal wx-share" id="wxShare">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <p>扫一扫，分享到微信</p>
    <img src="" alt="微信分享二维码">
</div>




    <script src="//cdn.bootcss.com/node-waves/0.7.4/waves.min.js"></script>
<script>
var BLOG = { ROOT: '/hexoblog/', SHARE: true, REWARD: true };


</script>

<script src="//unpkg.com/hexo-theme-material-indigo@latest/js/main.min.js"></script>


<div class="search-panel" id="search-panel">
    <ul class="search-result" id="search-result"></ul>
</div>
<template id="search-tpl">
<li class="item">
    <a href="{path}" class="waves-block waves-effect">
        <div class="title ellipsis" title="{title}">{title}</div>
        <div class="flex-row flex-middle">
            <div class="tags ellipsis">
                {tags}
            </div>
            <time class="flex-col time">{date}</time>
        </div>
    </a>
</li>
</template>

<script src="//unpkg.com/hexo-theme-material-indigo@latest/js/search.min.js" async></script>






<script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>



<script>
(function() {
    var OriginTitile = document.title, titleTime;
    document.addEventListener('visibilitychange', function() {
        if (document.hidden) {
            document.title = '去哪里了！';
            clearTimeout(titleTime);
        } else {
            document.title = '(つェ⊂)咦!又好了!';
            titleTime = setTimeout(function() {
                document.title = OriginTitile;
            },2000);
        }
    });
})();
</script>



</body>
</html>
